Some image forming apparatuses that form an image electrophotographically include an optical scanning mechanism having a rotary polygon mirror that deflects a light beam emitted from a light source to illuminate a photosensitive member. There has been proposed a known image forming apparatus including a driving motor for rotating a rotary polygon mirror, such as a brushless motor, and a plurality of Hall elements. In the known image forming apparatus, the rotation of the brushless motor is controlled while the position of the rotor is detected on the basis of signals output from the Hall elements.